import { defineStore } from "pinia";
import { store } from "/@/store";
import { postDictList } from "/@/api/common";

export const useCommonStore = defineStore({
  id: "pure-common",
  state: () => ({
    bussCateList:[]
  }),

  actions: {
    //获取审批业务类别
    async getBusCategory() {
      try {
        const params = {
          dicType: "rd_bus_category"
        };
        const { code, data } = await postDictList(params);
        if (code === 200) {
          this.bussCateList = data;
          return data
        }
      } catch (err) {
        console.log(err);
      }
    }
  }
});

export function useCommonStoreStoreHook() {
  return useCommonStore(store);
}
